package com.kuangstudy.base;

/**
 * ClassName: com.kuangstudy.base.Application
 * date: 2021/7/8/008
 *
 * @author zlk
 */
public class demo {
    public static void main(String[] args) {
        int i = 10;
        int i2 = 010;
        int i3 = 0x10;
        System.out.println(i);//10
        System.out.println(i2);//8
        System.out.println(i3);//16
        /*浮点数扩展
        * 避免使用浮点数做比较
        * BigDecimal
        * */
        float f = 0.1f;
        double d = 0.1;
        System.out.println(f == d);//false
        System.out.println(f);//0.1
        System.out.println(d);//0.1

        float d1 = 2333333333333333333333333f;
        float d2 = d1+1;
        System.out.println(d1 == d2);//true
        /*字符扩展,
        * 所有的字符本质还是数字
        * unicode表
        * */
        char c1 = 'a';
        System.out.println((int)c1);//97
        char c2 = '\u0061';
        System.out.println(c2);//a

        /*转义字符
        \t 制表符
        \n 换行
        */
        System.out.println("hello\tworld");//hello	world

        /**
         * 对象 从内存分析
         */
        String sa = new String("hello world");
        String sb = new String("hello world");
        System.out.println(sa == sb);//false

        String sc = "hello world";
        String sd = "hello world";
        System.out.println(sc == sd);//true



    }
}

